#ifndef __L_H__
#define __L_H__
#include <stdio.h>
#include <syslog.h>

#define l_e(fmt, arg...) do {\
    fprintf(stderr, "%s: " fmt "\n", __FUNCTION__, ## arg);\
    syslog(LOG_ERR, "%s: " fmt, __FUNCTION__, ## arg);\
} while (0)

#define l_w(fmt, arg...) do {\
    printf("%s: " fmt "\n", __FUNCTION__, ## arg);\
    syslog(LOG_WARNING, "%s: " fmt, __FUNCTION__, ## arg);\
} while (0)

#define l_n(fmt, arg...) do {\
    printf("%s: " fmt "\n", __FUNCTION__, ## arg);\
    syslog(LOG_NOTICE, "%s: " fmt, __FUNCTION__, ## arg);\
} while (0)

#define l_i(fmt, arg...) do {\
    printf("%s: " fmt "\n", __FUNCTION__, ## arg);\
    syslog(LOG_INFO, "%s: " fmt, __FUNCTION__, ## arg);\
} while (0)

#define l_d(fmt, arg...) do {\
    printf("%s: " fmt "\n", __FUNCTION__, ## arg);\
    syslog(LOG_DEBUG, "%s: " fmt, __FUNCTION__, ## arg);\
} while (0)

#endif /* ifndef __L_H__ */
